<?php
use think\facade\Route;

$dir  = app()->getRootPath() . '/app/plugin/route/list';
if(!file_exists($dir)){
    dir_mkdir($dir);
}
$list = folder_list($dir);

foreach ($list as $k=>$item){
    $get_plugin_json = file_get_contents($item['name']);
    $get_plugin = json_decode($get_plugin_json,true);
    foreach ($get_plugin as $value){
        Route::rule($value['url'],$value['controller'],$value['type']);
    }
}



